package cn.homework.day07;

import java.util.ArrayList;
import java.util.Collections;

public class Test01 {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        list.add(new Student("张三", 18, 96));
        list.add(new Student("李四", 16, 60));
        list.add(new Student("王五", 21, 50));
        list.add(new Student("赵六", 18, 86));
        list.add(new Student("小明", 15, 100));
        Student[] s = list.toArray(new Student[list.size()]);
        for (Student student : s) {
            System.out.println(student);
        }

        ArrayList<Person> list1 = new ArrayList<>();
        list1.add(new Person("小牛", 18, 96));
        list1.add(new Person("小花", 18, 100));
        ArrayList<Person> list2 = new ArrayList<>();
        list2.add(new Person("小美", 15, 100));
        list2.add(new Person("图图", 16, 100));

        list1.addAll(list2);
        System.out.println("=====");
        for (Person person : list1) {
            System.out.println(person);
        }

    }
}
